package org.come.Jpanel;

import com.tool.btn.MountPanelBtn;
import com.tool.btn.MountShouhuBtn;
import com.tool.image.ImageMixDeal;
import com.tool.role.RoleData;
import com.tool.tcp.SpriteFactory;
import com.tool.tcpimg.UIUtils;
import org.come.Frame.ZhuFrame;
import org.come.MountShouHu.*;
import org.come.bean.LoginResult;
import org.come.entity.Mount;
import org.come.login.SpriteBtn;
import org.come.socket.Agreement;
import org.come.socket.SendMessageUntil;
import org.come.until.*;

import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.plaf.basic.BasicScrollBarUI;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MountShouhuJpanel extends JPanel {
public static int zonglanidx = -1;
public static int shuxingidx = -1;
public static List<String> zonglan = new ArrayList<>();
public static List<String> shuxing = new ArrayList<>();
public static Map<String, List<String>> shuxingmap = new HashMap<>();
static Map<String, ImageIcon> mount = new HashMap<>();
private static JList<String> zonglanlsit;
private static final char[] CN_UPPER_NUMBER = {'零', '一', '二', '三', '四', '五', '六', '七', '八', '九'};
public static ImageIcon[] imageIcons1;
public static ImageIcon[] imageIcons2;
static {
	List<String> zhuque = new ArrayList<>();
	zhuque.add("1级 法力 +500");
	zhuque.add("2级 法力 +0.5%");
	zhuque.add("3级 气血 +500");
	zhuque.add("4级 忽视仙法鬼火+1.0%");
	zhuque.add("5级 法力 +500");
	zhuque.add("6级 法力 +0.5%");
	zhuque.add("7级 气血 +500");
	zhuque.add("8级 仙法鬼火命中率+0.5%");
	zhuque.add("9级 法力 +500");
	zhuque.add("10级 法力 +0.5%");
	zhuque.add("11级 气血 +500");
	zhuque.add("12级 忽视抗仙法鬼火+1.0%");
	zhuque.add("13级 法力 +500");
	zhuque.add("14级 法力 +0.5%");
	zhuque.add("15级 气血 +500");
	zhuque.add("16级 仙法鬼火命中率+0.5%");
	zhuque.add("17级 法力 +500");
	zhuque.add("18级 法力 +0.5%");
	zhuque.add("19级 气血 +500");
	zhuque.add("20级 忽视仙法鬼火+1.0%");
	zhuque.add("21级 法力 +500");
	zhuque.add("22级 法力 +0.5%");
	zhuque.add("23级 气血 +500");
	zhuque.add("24级 仙法鬼火命中率+0.5%");
	shuxingmap.put("朱雀", zhuque);
	List<String> qinglong = new ArrayList<>();
	qinglong.add("1级 速度 +2");
	qinglong.add("2级 物理吸收率+0.5%");
	qinglong.add("3级 气血 +500");
	qinglong.add("4级 速度 +0.2%");
	qinglong.add("5级 速度 +2");
	qinglong.add("6级 物理吸收率+0.5%");
	qinglong.add("7级 法力 +500");
	qinglong.add("8级 法术躲闪几率+0.5%");
	qinglong.add("9级 速度 +2");
	qinglong.add("10级 物理吸收率+0.5%");
	qinglong.add("11级 气血 +500");
	qinglong.add("12级 速度 +0.2%");
	qinglong.add("13级 速度 +2");
	qinglong.add("14级 物理吸收率+0.5%");
	qinglong.add("15级 法力 +500");
	qinglong.add("16级 法术躲闪几率+0.5%");
	qinglong.add("17级 速度 +2");
	qinglong.add("18级 物理吸收率+0.5%");
	qinglong.add("19级 气血 +500");
	qinglong.add("20级 速度 +0.2%");
	qinglong.add("21级 速度 +2");
	qinglong.add("22级 物理吸收率+0.5%");
	qinglong.add("23级 法力 +500");
	qinglong.add("24级 法术躲闪几率+0.5%");
	shuxingmap.put("青龙", qinglong);
	List<String> xuanwu = new ArrayList<>();
	xuanwu.add("1级 气血 +500");
	xuanwu.add("2级 气血 +0.5%");
	xuanwu.add("3级 法力 +500");
	xuanwu.add("4级 抗致命率+1.0%");
	xuanwu.add("5级 气血 +500");
	xuanwu.add("6级 气血 +0.5%");
	xuanwu.add("7级 法力 +500");
	xuanwu.add("8级 抗仙法鬼火狂暴率+1.0%");
	xuanwu.add("9级 气血 +500");
	xuanwu.add("10级 攻击 +0.5%");
	xuanwu.add("11级 法力 +500");
	xuanwu.add("12级 抗致命率+1.0%");
	xuanwu.add("13级 气血 +500");
	xuanwu.add("14级 气血 +0.5%");
	xuanwu.add("15级 法力 +500");
	xuanwu.add("16级 抗仙法鬼火狂暴率+1.0%");
	xuanwu.add("17级 气血 +500");
	xuanwu.add("18级 气血 +0.5%");
	xuanwu.add("19级 法力 +500");
	xuanwu.add("20级 抗致命率+1.0%");
	xuanwu.add("21级 气血 +500");
	xuanwu.add("22级 气血 +0.5%");
	xuanwu.add("23级 法力 +500");
	xuanwu.add("24级 抗仙法鬼火狂暴率+1.0%");
	shuxingmap.put("玄武", xuanwu);
	List<String> baihu = new ArrayList<>();
	baihu.add("1级 攻击 +200");
	baihu.add("2级 攻击 +0.5%");
	baihu.add("3级 气血 +500");
	baihu.add("4级 狂暴率+1.0%");
	baihu.add("5级 攻击 +200");
	baihu.add("6级 攻击 +0.5%");
	baihu.add("7级 气血 +500");
	baihu.add("8级 命中率+1.0%");
	baihu.add("9级 攻击 +200");
	baihu.add("10级 攻击 +0.5%");
	baihu.add("11级 气血 +500");
	baihu.add("12级 狂暴率+1.0%");
	baihu.add("13级 攻击 +200");
	baihu.add("14级 攻击 +0.5%");
	baihu.add("15级 气血 +500");
	baihu.add("16级 命中率+1.0%");
	baihu.add("17级 攻击 +200");
	baihu.add("18级 攻击 +0.5%");
	baihu.add("19级 气血 +500");
	baihu.add("20级 狂暴率+1.0%");
	baihu.add("21级 攻击 +200");
	baihu.add("22级 攻击 +0.5%");
	baihu.add("23级 气血 +500");
	baihu.add("24级 命中率+1.0%");
	shuxingmap.put("白虎", baihu);
	for (int i = 1; i <= 7; i++) {
		ImageIcon imageIcon = new ImageIcon("inkImg/Client/zqhead/50x50_鬼" + i + ".png");
		ImageIcon imageIcon1 = new ImageIcon("inkImg/Client/zqhead/50x50_龙" + i + ".png");
		ImageIcon imageIcon2 = new ImageIcon("inkImg/Client/zqhead/50x50_魔" + i + ".png");
		ImageIcon imageIcon3 = new ImageIcon("inkImg/Client/zqhead/50x50_仙" + i + ".png");
		ImageIcon imageIcon4 = new ImageIcon("inkImg/Client/zqhead/50x50_人" + i + ".png");
		mount.put("50x50_鬼" + i, imageIcon);
		mount.put("50x50_龙" + i, imageIcon1);
		mount.put("50x50_魔" + i, imageIcon2);
		mount.put("50x50_仙" + i, imageIcon3);
		mount.put("50x50_人" + i, imageIcon4);
	}
	try {
		imageIcons1=CutButtonImage.cuts("inkImg/Client/守护石圆圈带守护石.png");
		imageIcons2=CutButtonImage.cuts("inkImg/Client/守护石圆圈带未点亮守护石.png");
	} catch (Exception e) {
		e.printStackTrace();
	}


}

private final ImageIcon hengtiao = new ImageIcon("inkImg/Client/待升级后解锁.png");
private final ImageIcon xuanze = new ImageIcon("inkImg/Client/选择坐骑界面.png");
private final ImageIcon hengtiao1 = new ImageIcon("inkImg/Client/可解锁.png");
private final ImageIcon xuanze1 = new ImageIcon("inkImg/Client/可解锁不带所图标格.png");
private final JScrollPane jScrollPane_shuxing;
private final JScrollPane jScrollPane_zonglan;
private final JList<String> shuxinglsit;
private final DefaultListModel<String> shuxingmodel;
public ShouHu shouHu;
public JLabel sixiang1zuoqi;
public MountShouhuBtn shengji;
public MountShouhuBtn fuling;
public int xuanzhong = 0;
public MountShouhuBtn[] sixiang = new MountShouhuBtn[7];
public MountShouhuBtn[] hengtiaoxianshi = new MountShouhuBtn[7];
public JTextPane ZTlvl;
public JTextPane QLlvl;
public JTextPane BHlvl;
public JTextPane ZQlvl;
public JTextPane XUlvl;
public JTextPane BHname;
public JTextPane QLname;
public JTextPane XUname;
public JTextPane ZQname;
public SpriteBtn tcp;
public SpriteBtn tcp1;
public MountShouhuBtn shouhushi;
private ImageIcon ico = new ImageIcon("inkImg/Client/守护背景.png");
private List<MountPanelBtn> shouhu = new ArrayList<>();
private MountShouhuBtn qinglong;
private MountShouhuBtn baihu;
private MountShouhuBtn xuanwu;
private MountShouhuBtn zhuque;
private MountShouhuBtn zhongtian;
private JLabel sixiang1;
private JLabel sixiang2;
private DefaultListModel<String> zonglanmode;
public MountShouhuBtn shouhuBtn[]=new MountShouhuBtn[7];
public int zuoqi=-1;
public int SX=-1;
public boolean s=false;
public int l=-1;
public  int fenjie=0;
public MountShouhuJpanel() {
	this.setPreferredSize(new Dimension(740, 516));
	this.setLayout(null);
	this.setBackground(UIUtils.Color_BACK);
	MountPanelBtn btn = new MountPanelBtn("inkImg/Client/未选中按钮.png", 1, "坐骑", this, 9, UIUtils.Black);
	btn.setBounds(50, 15, 100, 33);
	add(btn);
	shouhu.add(btn);
	MountPanelBtn btn1 = new MountPanelBtn("inkImg/Client/未选中按钮.png", 1, "守护", this, 10, UIUtils.Black);
	btn1.setBounds(160, 15, 100, 33);
	add(btn1);
	shouhu.add(btn1);
	//中天 129 254 青龙 64 305 白虎 199 171 玄武 163 400 朱雀 84 72
/*	tcp=new SpriteBtn("inkImg/Client/动效_青龙白虎朱雀玄龟.tcp",100,100,false);
	(this.tcp = new SpriteBtn("inkImg/Client/动效_青龙白虎朱雀玄龟.tcp", 520, 390, false)).setBounds(520, 390, 60, 30);
	this.add(tcp);
	tcp1=new SpriteBtn("inkImg/Client/动效_中天.tcp",100,100,false);*/
	ZTlvl = new JTextPane();
	ZTlvl.setFont(UIUtils.TEXT_FONT1);
	ZTlvl.setBounds(124, 255, 15, 20);
	ZTlvl.setOpaque(false);
	ZTlvl.setForeground(Color.white);
	ZTlvl.setText("0");
	ZTlvl.setEnabled(false);
	this.add(ZTlvl);
	QLlvl = new JTextPane();
	QLlvl.setFont(UIUtils.TEXT_FONT1);
	QLlvl.setBounds(60, 305, 15, 20);
	QLlvl.setOpaque(false);
	QLlvl.setForeground(Color.white);
	QLlvl.setText("0");
	QLlvl.setEnabled(false);
	this.add(QLlvl);
	BHlvl = new JTextPane();
	BHlvl.setFont(UIUtils.TEXT_FONT1);
	BHlvl.setBounds(199, 170, 15, 20);
	BHlvl.setOpaque(false);
	BHlvl.setForeground(Color.white);
	BHlvl.setText("0");
	BHlvl.setEnabled(false);
	this.add(BHlvl);
	XUlvl = new JTextPane();
	XUlvl.setFont(UIUtils.TEXT_FONT1);
	XUlvl.setBounds(160, 402, 15, 20);
	XUlvl.setOpaque(false);
	XUlvl.setForeground(Color.white);
	XUlvl.setText("0");
	XUlvl.setEnabled(false);
	this.add(XUlvl);
	ZQlvl = new JTextPane();
	ZQlvl.setFont(UIUtils.TEXT_FONT1);
	ZQlvl.setBounds(86, 81, 15, 20);
	ZQlvl.setOpaque(false);
	ZQlvl.setForeground(Color.white);
	ZQlvl.setText("0");
	ZQlvl.setEnabled(false);
	this.add(ZQlvl);
	BHname = new JTextPane();
	BHname.setOpaque(false);
	BHname.setBounds(198, 200, 50, 50);
	BHname.setForeground(new Color(0x959595));
	BHname.setText("白\n虎");
	BHname.setEnabled(false);
	BHname.setFont(UIUtils.TEXT_FONT42.deriveFont(1));
	this.add(BHname);
	QLname = new JTextPane();
	QLname.setOpaque(false);
	QLname.setBounds(60, 330, 50, 50);
	QLname.setForeground(new Color(0x959595));
	QLname.setText("青\n龙");
	QLname.setFont(UIUtils.TEXT_FONT42.deriveFont(1));
	QLname.setEnabled(false);
	this.add(QLname);
	ZQname = new JTextPane();
	ZQname.setOpaque(false);
	ZQname.setBounds(83, 104, 50, 50);
	ZQname.setForeground(new Color(0x959595));
	ZQname.setText("朱\n雀");
	ZQname.setFont(UIUtils.TEXT_FONT42.deriveFont(1));
	ZQname.setEnabled(false);
	this.add(ZQname);
	XUname = new JTextPane();
	XUname.setOpaque(false);
	XUname.setBounds(157, 425, 50, 50);
	XUname.setForeground(new Color(0x959595));
	XUname.setText("玄\n武");
	XUname.setFont(UIUtils.TEXT_FONT42.deriveFont(1));
	XUname.setEnabled(false);
	this.add(XUname);
	zhongtian = new MountShouhuBtn("inkImg/Client/中天_未选中.png", 1, 4, this, SpriteFactory.VloadSprite("inkImg/Client/动效_中天.tcp", null), 62, 70, false);
	zhongtian.setBounds(55+15, 160+19, 136, 142);
	add(zhongtian);
	qinglong = new MountShouhuBtn("inkImg/Client/青龙_未选中.png", 1, 0, this, SpriteFactory.VloadSprite("inkImg/Client/动效_青龙白虎朱雀玄龟.tcp", null), 23, 163, false);
	qinglong.setBounds(46, 160+35, 74, 235);
	add(qinglong);
	xuanwu = new MountShouhuBtn("inkImg/Client/玄武_未选中.png", 1, 1, this, SpriteFactory.VloadSprite("inkImg/Client/动效_青龙白虎朱雀玄龟.tcp", null), 122, 62, false);
	xuanwu.setBounds(48, 388+6, 138, 103);
	add(xuanwu);
	zhuque = new MountShouhuBtn("inkImg/Client/朱雀_未选中.png", 1, 2, this, SpriteFactory.VloadSprite("inkImg/Client/动效_青龙白虎朱雀玄龟.tcp", null), 40, 82, false);
	zhuque.setBounds(55, 50, 184, 134);
	add(zhuque);
	baihu = new MountShouhuBtn("inkImg/Client/白虎_未选中.png", 1, 3, this, SpriteFactory.VloadSprite("inkImg/Client/动效_青龙白虎朱雀玄龟.tcp", null), 63, 63, false);
	baihu.setBounds(130+15, 158, 104, 206);
	add(baihu);
	(sixiang1 = new JLabel()).setIcon(CutButtonImage.getImage("inkImg/Client/可添加坐骑格.png", -1, -1));
	sixiang1.setBounds(355, 142, 60, 60);
	sixiang1.setVisible(true);
	sixiang1.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseClicked(MouseEvent e) {
			super.mouseClicked(e);
			//System.out.println("四象1");
			if (e.getButton() == MouseEvent.BUTTON1) {
				FormsManagement.showForm(2255);
				SX=1;
			} else {
				sixiang1.setBounds(355, 142, 60, 60);
				sixiang1.setIcon(CutButtonImage.getImage("inkImg/Client/可添加坐骑格.png", -1, -1));
				String mes=RoleData.getRoleData().getLoginResult().getZhongtian();
				if (mes!=null){
					String[] mes1 =mes.split("\\|");
					mes1[2]="0*"+mes.split("\\|")[2].split("\\*")[1];
					RoleData.getRoleData().getLoginResult().setZhongtian(mes1[0]+"|"+mes1[1]+"|"+mes1[2]);
				}else {
					RoleData.getRoleData().getLoginResult().setZhongtian("-1|-1|0*-1");
				}
				shouHu.setZhongtianmount(RoleData.getRoleData().getLoginResult().getZhongtian().split("\\|")[2]);
				SendMessageUntil.toServer(Agreement.getAgreement().shouhuAgreement(GsonUtil.getGsonUtil().getgson().toJson(shouHu)));
				String m[]=RoleData.getRoleData().getLoginResult().getSh().split("\\|");
				m[getXuanzhong()-1]=m[getXuanzhong()-1].split("-")[0]+"-0"+"-"+m[getXuanzhong()-1].split("-")[2];
				RoleData.getRoleData().getLoginResult().setSh(m[0]+"|"+m[1]+"|"+m[2]+"|"+m[3]);
				SendMessageUntil.toServer( Agreement.getAgreement().rolechangeAgreement("TT&"+RoleData.getRoleData().getLoginResult().getSh()));
				List<Mount>  mountList= UserMessUntil.getMountlsit();
				for (int i=0;i<=mountList.size()-1;i++){
					if (mountList.get(i).getSh()!=0&&(mountList.get(i).getSh())==xuanzhong){
						mountList.get(i).setSh(0);
						String sendmes1 = Agreement.getAgreement().changeMountValue(GsonUtil.getGsonUtil().getgson().toJson(mountList.get(i)));
						SendMessageUntil.toServer(sendmes1);
					}
				}
			}


		}
	});
	add(sixiang1);
	(sixiang2 = new JLabel()).setIcon(CutButtonImage.getImage("inkImg/Client/待解锁坐骑格.png", -1, -1));
	sixiang2.setBounds(575, 142, 60, 60);
	sixiang2.setVisible(true);
	sixiang2.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseClicked(MouseEvent e) {
			super.mouseClicked(e);
			// System.out.println("四象2");
			/*if (shouHu.zhongtianlvl<16){
				ZhuFrame.getZhuJpanel().addPrompt2("需要中天等级达到16级");
				return;
			}*/
			switch (xuanzhong){
				case 1:
					if (shouHu.getQinglonglvl()<16){
						ZhuFrame.getZhuJpanel().addPrompt2("需要青龙等级达到16级");
						return;
					}
					break;
				case 2:
					if (shouHu.getBaihulvl()<16){
						ZhuFrame.getZhuJpanel().addPrompt2("需要白虎等级达到16级");
						return;
					}
					break;
				case 3:
					if (shouHu.getXuanwulvl()<16){
						ZhuFrame.getZhuJpanel().addPrompt2("需要玄武等级达到16级");
						return;
					}
					break;
				case 4:
					if (shouHu.getZhuquelvl()<16){
						ZhuFrame.getZhuJpanel().addPrompt2("需要朱雀等级达到16级");
						return;
					}
					break;
			}if (e.getButton() == MouseEvent.BUTTON1) {
				FormsManagement.showForm(2255);
				SX=2;
			} else {
				sixiang2.setBounds(580, 142, 60, 60);
				sixiang2.setIcon(CutButtonImage.getImage("inkImg/Client/可添加坐骑格.png", -1, -1));
				String mes=RoleData.getRoleData().getLoginResult().getZhongtian();
				if (mes!=null){
					String[] mes1 =mes.split("\\|");
					mes1[2]=mes.split("\\|")[2].split("\\*")[0]+"*0";
					RoleData.getRoleData().getLoginResult().setZhongtian(mes1[0]+"|"+mes1[1]+"|"+mes1[2]);
				}else {
					RoleData.getRoleData().getLoginResult().setZhongtian("-1|-1|-1*0");
				}
				shouHu.setZhongtianmount(RoleData.getRoleData().getLoginResult().getZhongtian().split("\\|")[2]);
				SendMessageUntil.toServer(Agreement.getAgreement().shouhuAgreement(GsonUtil.getGsonUtil().getgson().toJson(shouHu)));
				List<Mount>  mountList= UserMessUntil.getMountlsit();
				String m[]=RoleData.getRoleData().getLoginResult().getSh().split("\\|");
				m[getXuanzhong()-1]=m[getXuanzhong()-1].split("-")[0]+"-"+m[getXuanzhong()-1].split("-")[1]+"-0";
				RoleData.getRoleData().getLoginResult().setSh(m[0]+"|"+m[1]+"|"+m[2]+"|"+m[3]);
				SendMessageUntil.toServer( Agreement.getAgreement().rolechangeAgreement("TT&"+RoleData.getRoleData().getLoginResult().getSh()));
				for (int i=0;i<=mountList.size()-1;i++){
					if (mountList.get(i).getSh()!=0&&(mountList.get(i).getSh())==xuanzhong){
						mountList.get(i).setSh(0);
						String sendmes1 = Agreement.getAgreement().changeMountValue(GsonUtil.getGsonUtil().getgson().toJson(mountList.get(i)));
						SendMessageUntil.toServer(sendmes1);
					}
				}
			}


		}
	});
	add(sixiang2);
	zonglanmode = new DefaultListModel();
	(zonglanlsit = new JList<String>(zonglanmode) {
		{
			this.setOpaque(false);
		}
	}).setSelectionBackground(new Color(33, 42, 52));
	zonglanlsit.setSelectionMode(0);
	zonglanlsit.setBackground(UIUtils.Color_BACK);
	zonglanlsit.setCellRenderer(new ZonglanRenderer());
	(this.jScrollPane_zonglan = new JScrollPane(zonglanlsit)).setVerticalScrollBarPolicy(22);
	this.jScrollPane_zonglan.getViewport().setOpaque(false);
	this.jScrollPane_zonglan.setOpaque(false);
	this.jScrollPane_zonglan.setBorder(BorderFactory.createEmptyBorder());
	this.jScrollPane_zonglan.setHorizontalScrollBarPolicy(31);
	this.jScrollPane_zonglan.setBounds(515, 344, 190, 120);
	jScrollPane_zonglan.getVerticalScrollBar().setUI(new CustomScrollBarUI());
	this.add(this.jScrollPane_zonglan);
	shuxingmodel = new DefaultListModel();
	(shuxinglsit = new JList<String>(shuxingmodel) {
		{
			this.setOpaque(false);
		}
	}).setSelectionBackground(new Color(33, 42, 52));
	shuxinglsit.setSelectionMode(0);
	shuxinglsit.setBackground(UIUtils.Color_BACK);
	shuxinglsit.setCellRenderer(new shuxingRenderer());
	(this.jScrollPane_shuxing = new JScrollPane(shuxinglsit)).setVerticalScrollBarPolicy(22);
	this.jScrollPane_shuxing.getViewport().setOpaque(false);
	this.jScrollPane_shuxing.setOpaque(false);
	this.jScrollPane_shuxing.setBorder(BorderFactory.createEmptyBorder());
	this.jScrollPane_shuxing.setHorizontalScrollBarPolicy(31);
	this.jScrollPane_shuxing.setBounds(280, 344, 210, 120);
	jScrollPane_shuxing.getVerticalScrollBar().setUI(new CustomScrollBarUI());
	this.add(this.jScrollPane_shuxing);
	shengji = new MountShouhuBtn("inkImg/Client/升级按钮.png", 1, 6, "升 级", UIUtils.Black, UIUtils.TEXT_HY17, this);
	shengji.setBounds(450, 470, 96, 28);
	this.add(shengji);
	fuling = new MountShouhuBtn("inkImg/Client/附灵按钮.png", 1, 7, "赋灵", UIUtils.Black, UIUtils.TEXT_HY17, this);
	fuling.setBounds(250, 270, 74, 36);
	this.add(fuling);
	//1.490 100  2.390 115 3.310 170 4.430 235 5.550 235 6.680 170 7.590 115
	for (int i = 0; i < 7; i++) {
		sixiang[i] = new MountShouhuBtn("inkImg/Client/无加号待解锁格.png", 1, 50 + i, this);
		sixiang[i].addMouseListener(new TxtMoulisten(i));
		shouhuBtn[i] = new MountShouhuBtn("inkImg/Client/守护石圆圈带未点亮守护石.png", 1, 60 + i, this);
		hengtiaoxianshi[i] = new MountShouhuBtn("inkImg/Client/待升级后解锁.png", -1);
		switch (i) {
			case 0:
				sixiang[i].setBounds(450, 65, 60, 60);
				shouhuBtn[i].setBounds(490,100,32,32);
				break;
			case 1:
				sixiang[i].setBounds(345, 80, 60, 60);
				shouhuBtn[i].setBounds(390,115,32,32);
				break;
			case 2:
				sixiang[i].setBounds(265, 135, 60, 60);
				shouhuBtn[i].setBounds(310,170,32,32);
				break;
			case 3:
				sixiang[i].setBounds(390, 200, 60, 60);
				shouhuBtn[i].setBounds(430,235,32,32);
				break;
			case 4:
				sixiang[i].setBounds(510, 200, 60, 60);
				shouhuBtn[i].setBounds(550,235,32,32);
				break;
			case 5:
				sixiang[i].setBounds(640, 135, 60, 60);
				shouhuBtn[i].setBounds(680,170,32,32);
				break;
			case 6:
				sixiang[i].setBounds(550, 80, 60, 60);
				shouhuBtn[i].setBounds(590,115,32,32);
				break;

		}
		hengtiaoxianshi[i].setVisible(false);
		hengtiaoxianshi[i].setBounds(sixiang[i].getX() + 10, sixiang[i].getY() + 20, 37, 23);
		sixiang[i].setVisible(false);
		sixiang[i].setOpaque(false);
		sixiang[i].setBackground(new Color(0, 0, 0, 0));
		sixiang[i].setLayout(new BorderLayout());
		shouhuBtn[i].setVisible(false);
		shouhuBtn[i].setBackground(new Color(0, 0, 0, 0));
		shouhuBtn[i].addMouseListener(new ShouhuPackGoodsMouslisten(i+60));
		add(shouhuBtn[i]);
		add(hengtiaoxianshi[i]);
		add(sixiang[i]);

	}


}

public static Object[] calculateTotalAttackValue(DefaultListModel<String> shuxingList, int lvl, String value) {
	int fixedAttackValue = 0;
	double percentageAttackValue = 0.0;
	if (lvl>=shuxingList.size())lvl=shuxingList.getSize();
	for (int i = 0; i < lvl; i++) {
		String attribute = shuxingList.get(i);
		if (attribute.contains(value)) {
			String[] parts = attribute.split(value);
			if (parts.length >= 2) {
				String valuePart = parts[1].trim();
				if (valuePart.endsWith("+")) {
					// 处理没有空格的情况
					valuePart = valuePart.substring(1); // 去除+号
				}
				if (valuePart.endsWith("%")) {
					// 处理百分比属性
					double percentageValue = Double.parseDouble(valuePart.substring(0, valuePart.length() - 1));
					percentageAttackValue += percentageValue;
				} else {
					// 处理固定值属性
					try {
						int fixedValue = Integer.parseInt(valuePart);
						fixedAttackValue += fixedValue;
					} catch (NumberFormatException e) {
						// 处理无法解析为整数的情况，这里可以添加错误处理逻辑
						// 比如打印错误消息或记录日志
					}
				}
			}
		}
	}

	return new Object[]{fixedAttackValue, percentageAttackValue};
}

public void shou() {
	//0中天 1青龙 2白虎 3玄武 4朱雀
	//zonglanmode.addElement("青龙");
	zonglan.clear();
	zonglanmode.clear();
	shuxingmodel.clear();
	shuxing.clear();
	ZTlvl.setText(String.valueOf(shouHu.getZhongtianlvl() == -1 ? 0 : shouHu.getZhongtianlvl()));
	QLlvl.setText(String.valueOf(shouHu.getQinglonglvl() == -1 ? 0 : shouHu.getQinglonglvl()));
	BHlvl.setText(String.valueOf(shouHu.getBaihulvl() == -1 ? 0 : shouHu.getBaihulvl()));
	ZQlvl.setText(String.valueOf(shouHu.getZhuquelvl() == -1 ? 0 : shouHu.getZhuquelvl()));
	XUlvl.setText(String.valueOf(shouHu.getXuanwulvl() == -1 ? 0 : shouHu.getXuanwulvl()));
	switch (xuanzhong) {
		case 0:
			shuxingmodel.addElement("1级 青龙守护属性提升10%");
			shuxingmodel.addElement("2级 白虎守护属性提升10%");
			shuxingmodel.addElement("3级 朱雀守护属性提升10%");
			shuxingmodel.addElement("4级 玄武守护属性提升10%");
			shuxingmodel.addElement("5级 青龙守护属性提升15%");
			shuxingmodel.addElement("6级 白虎守护属性提升15%");
			shuxingmodel.addElement("7级 朱雀守护属性提升15%");
			shuxingmodel.addElement("8级 玄武守护属性提升15%");
			shuxingmodel.addElement("9级 青龙守护属性提升15%");
			shuxingmodel.addElement("10级 白虎守护属性提升15%");
			shuxingmodel.addElement("11级 朱雀守护属性提升15%");
			shuxingmodel.addElement("12级 玄武守护属性提升15%");
			shuxingmodel.addElement("13级 青龙守护属性提升20%");
			shuxingmodel.addElement("14级 白虎守护属性提升20%");
			shuxingmodel.addElement("15级 朱雀守护属性提升20%");
			shuxingmodel.addElement("16级 玄武守护属性提升20%");
			shuxingmodel.addElement("17级 青龙守护属性提升20%");
			shuxingmodel.addElement("18级 白虎守护属性提升20%");
			shuxingmodel.addElement("19级 朱雀守护属性提升20%");
			shuxingmodel.addElement("20级 玄武守护属性提升20%");
			shuxingmodel.addElement("21级 青龙守护属性提升20%");
			shuxingmodel.addElement("22级 白虎守护属性提升20%");
			shuxingmodel.addElement("23级 朱雀守护属性提升20%");
			shuxingmodel.addElement("24级 玄武守护属性提升20%");
			int k = Math.min(shouHu.zhongtianlvl, 24);
			int q = 0;
			int b = 0;
			int x = 0;
			int z = 0;
			for (int i = 0; i <= k - 1; i++) {
				if (shuxingmodel.elementAt(i).contains("青龙")) {
					char secondLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 3);
					char thirdLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 2);
					q = q + Integer.parseInt(String.valueOf(secondLastChar)) * 10 + Integer.parseInt(String.valueOf(thirdLastChar));

				} else if (shuxingmodel.elementAt(i).contains("白虎")) {
					char secondLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 3);
					char thirdLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 2);
					b = b + Integer.parseInt(String.valueOf(secondLastChar)) * 10 + Integer.parseInt(String.valueOf(thirdLastChar));
				}
				if (shuxingmodel.elementAt(i).contains("朱雀")) {
					char secondLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 3);
					char thirdLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 2);
					z = z + Integer.parseInt(String.valueOf(secondLastChar)) * 10 + Integer.parseInt(String.valueOf(thirdLastChar));
				}
				if (shuxingmodel.elementAt(i).contains("玄武")) {
					char secondLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 3);
					char thirdLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 2);
					x = x + Integer.parseInt(String.valueOf(secondLastChar)) * 10 + Integer.parseInt(String.valueOf(thirdLastChar));
				}
			}
			if (q != 0) {
				zonglanmode.addElement("青龙守护属性提升" + q + "%");
				zonglan.add("青龙守护属性提升" + q + "%");
			}
			if (b != 0) {
				zonglanmode.addElement("白虎守护属性提升" + b + "%");
				zonglan.add("白虎守护属性提升" + b + "%");
			}
			if (z != 0) {
				zonglanmode.addElement("朱雀守护属性提升" + z + "%");
				zonglan.add("朱雀守护属性提升" + z + "%");
			}
			if (x != 0) {
				zonglanmode.addElement("玄武守护属性提升" + x + "%");
				zonglan.add("玄武守护属性提升" + x + "%");
			}
			break;
		case 1:
			for (int i = 0; i <= shuxingmap.get("青龙").size() - 1; i++) {
				shuxingmodel.addElement(shuxingmap.get("青龙").get(i));
			}
			Object[] attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.qinglonglvl, "速度");
			int fixedAttackValue = (int) attackValues[0];
			double percentageAttackValue = (double) attackValues[1];
			if (fixedAttackValue!=0)
			zonglanmode.addElement("速度 +" + fixedAttackValue);
			if (percentageAttackValue!=0)
			zonglanmode.addElement("速度 +" + percentageAttackValue + "%");
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.qinglonglvl, "气血");
			fixedAttackValue = (int) attackValues[0];
			if (fixedAttackValue!=0)
			zonglanmode.addElement("气血 +" + fixedAttackValue);
			 attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.qinglonglvl, "法力");
			fixedAttackValue = (int) attackValues[0];
			if (fixedAttackValue!=0)
			zonglanmode.addElement("法力 +" + fixedAttackValue);
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.qinglonglvl, "物理吸收率");
			percentageAttackValue = (double) attackValues[1];//命中率
			if (percentageAttackValue!=0)
			zonglanmode.addElement("物理吸收率 +" + percentageAttackValue + "%");
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.qinglonglvl, "法术躲闪几率");
			percentageAttackValue = (double) attackValues[1];
			if (percentageAttackValue!=0)
			zonglanmode.addElement("法术躲闪几率 +" + percentageAttackValue + "%");

			for (int p = 0; p <= zonglanmode.size() - 1; p++) {
				zonglan.add(zonglanmode.get(p));
			}
			break;
		case 2:
			for (int i = 0; i <= shuxingmap.get("白虎").size() - 1; i++) {
				shuxingmodel.addElement(shuxingmap.get("白虎").get(i));
			}
			 attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.baihulvl, "攻击");
			 fixedAttackValue = (int) attackValues[0];
			 percentageAttackValue = (double) attackValues[1];
			 if (fixedAttackValue!=0)
			zonglanmode.addElement("攻击 +" + fixedAttackValue);
			if (percentageAttackValue!=0)
			zonglanmode.addElement("攻击 +" + percentageAttackValue + "%");
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.baihulvl, "气血");
			fixedAttackValue = (int) attackValues[0];
			percentageAttackValue = (double) attackValues[1];
			if (fixedAttackValue!=0)
			zonglanmode.addElement("气血 +" + fixedAttackValue);
			if (percentageAttackValue!=0)
			zonglanmode.addElement("气血 +" + percentageAttackValue+"%");
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.baihulvl, "狂暴率");
			percentageAttackValue = (double) attackValues[1];//命中率
			if (percentageAttackValue!=0)
			zonglanmode.addElement("狂暴率 +" + percentageAttackValue + "%");
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.baihulvl, "命中率");
			percentageAttackValue = (double) attackValues[1];
			if (percentageAttackValue!=0)
			zonglanmode.addElement("命中率 +" + percentageAttackValue + "%");
			for (int p = 0; p <= zonglanmode.size() - 1; p++) {
				zonglan.add(zonglanmode.get(p));
			}
			break;
		case 3:
			for (int i = 0; i <= shuxingmap.get("玄武").size() - 1; i++) {
				shuxingmodel.addElement(shuxingmap.get("玄武").get(i));
			}
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.xuanwulvl, "气血");
			fixedAttackValue = (int) attackValues[0];
			percentageAttackValue = (double) attackValues[1];
			if (fixedAttackValue!=0)
			zonglanmode.addElement("气血 +" + fixedAttackValue);
			if (percentageAttackValue!=0)
			zonglanmode.addElement("气血 +" + percentageAttackValue+"%");
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.xuanwulvl, "法力");
			fixedAttackValue = (int) attackValues[0];
			percentageAttackValue = (double) attackValues[1];
			if (fixedAttackValue!=0)
			zonglanmode.addElement("法力 +" + fixedAttackValue);
			if (percentageAttackValue!=0)
			zonglanmode.addElement("法力 +" + percentageAttackValue+"%");
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.xuanwulvl, " 抗致命率");
			percentageAttackValue = (double) attackValues[1];//命中率
			if (percentageAttackValue!=0)
			zonglanmode.addElement("抗致命率 +" + percentageAttackValue + "%");
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.xuanwulvl, "抗仙法鬼火狂暴率");
			percentageAttackValue = (double) attackValues[1];
			if (percentageAttackValue!=0)
			zonglanmode.addElement("抗仙法鬼火狂暴率 +" + percentageAttackValue + "%");
			for (int p = 0; p <= zonglanmode.size() - 1; p++) {
				zonglan.add(zonglanmode.get(p));
			}
			break;
		case 4:
			for (int i = 0; i <= shuxingmap.get("朱雀").size() - 1; i++) {
				shuxingmodel.addElement(shuxingmap.get("朱雀").get(i));
			}
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.zhuquelvl, "法力");
			fixedAttackValue = (int) attackValues[0];
			percentageAttackValue = (double) attackValues[1];
			if (fixedAttackValue!=0)
			zonglanmode.addElement("法力 +" + fixedAttackValue);
			if (percentageAttackValue!=0)
			zonglanmode.addElement("法力 +" + percentageAttackValue + "%");
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.zhuquelvl, "气血");
			fixedAttackValue = (int) attackValues[0];
			percentageAttackValue = (double) attackValues[1];
			if (fixedAttackValue!=0)
			zonglanmode.addElement("气血 +" + fixedAttackValue);
			if (percentageAttackValue!=0)
			zonglanmode.addElement("气血 +" + percentageAttackValue+"%");
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.zhuquelvl, " 忽视仙法鬼火");
			percentageAttackValue = (double) attackValues[1];//命中率
			if (percentageAttackValue!=0)
			zonglanmode.addElement("忽视仙法鬼火 +" + percentageAttackValue + "%");
			attackValues = calculateTotalAttackValue(shuxingmodel, shouHu.zhuquelvl, "仙法鬼火命中率");
			percentageAttackValue = (double) attackValues[1];
			if (percentageAttackValue!=0)
			zonglanmode.addElement("仙法鬼火命中率 +" + percentageAttackValue + "%");
			for (int p = 0; p <= zonglanmode.size() - 1; p++) {
				zonglan.add(zonglanmode.get(p));
			}
			break;
	}
	for (int i = 0; i <= shuxingmodel.size() - 1; i++) {
		shuxing.add(shuxingmodel.get(i));
	}
	if (xuanzhong == 0) {
		sixiang1.setVisible(false);
		sixiang2.setVisible(false);
		setIco(new ImageIcon("inkImg/Client/守护背景.png"));
		zhongtian.setIschoose(true);
	} else {
		sixiang1.setVisible(true);
		sixiang2.setVisible(true);
		setIco(new ImageIcon("inkImg/Client/四象背景.png"));

	}
/*	if (RoleData.getRoleData().getLoginResult().getZhongtian()!=null){
		String[] mes =RoleData.getRoleData().getLoginResult().getZhongtian().split("\\|")[2].split("\\*");
		if (!mes[0].equals("null")){
			if (Integer.parseInt(mes[0])==0){
				//MountShouhuBtn.setsixiang(this,Integer.parseInt(mes[0]),1);
				sixiang1.setBounds(355, 142, 60, 60);
				sixiang1.setIcon(CutButtonImage.getImage("inkImg/Client/可添加坐骑格.png", -1, -1));
			}else if (Integer.parseInt(mes[0])!=-1){
				MountShouhuBtn.setsixiang(this,Integer.parseInt(mes[0]),1);
			}
			if (Integer.parseInt(mes[1])==0){
				//MountShouhuBtn.setsixiang(this,Integer.parseInt(mes[0]),1);
				sixiang2.setBounds(580, 142, 60, 60);
				sixiang2.setIcon(CutButtonImage.getImage("inkImg/Client/可添加坐骑格.png", -1, -1));
			}else if (Integer.parseInt(mes[1])!=-1){
				MountShouhuBtn.setsixiang(this,Integer.parseInt(mes[1]),2);
			}
		}

	}*/
}

@Override
protected void paintComponent(Graphics g) {
	super.paintComponent(g);
	if (ico != null)
		g.drawImage(ico.getImage(), 0, 0, 740, 516, null);
	LoginResult loginResult = RoleData.getRoleData().getLoginResult();
	g.setFont((UIUtils.TEXT_MSGX).deriveFont(16));
	g.setColor(new Color(0x959595));
	//   g.drawString("莲花[四座]",345,225);
	if (xuanzhong != 0) {
		for (int i = 0; i < 7; i++) {
			sixiang[i].setVisible(false);
			hengtiaoxianshi[i].setVisible(false);
			shouhuBtn[i].setVisible(false);
		}
		if (loginResult.getSh()!=null){
			String[] mes =loginResult.getSh().split("\\|")[xuanzhong-1].split("-");
			List<Mount> mountList=UserMessUntil.getMountlsit();
			if (mes[1].equals("1")||mes[1].equals("2")||mes[1].equals("3")||mes[1].equals("4")||mes[1].equals("5")||mes[1].equals("6")||mes[1].equals("7")){//
				mountList.forEach(e->{
					if (e.getMountid()==Integer.parseInt(mes[1])){
						g.setColor(new Color(0xc9bd86));
						g.drawString(" "+CN_UPPER_NUMBER[e.getMountid()]+"·"+ e.getMountname().split(" ")[0],350,230);
					}
				});

			}else if (mes[1].equals("0")){
				g.setColor(new Color(0xc9bd86));
				g.drawString("待放入坐骑",350,230);
			}else if (mes[1].equals("-1")){
				g.setColor(new Color(0xc9bd86));
				g.drawString("待解锁",350,230);
			}
			if (mes[2].equals("1")||mes[2].equals("2")||mes[2].equals("3")||mes[2].equals("4")||mes[2].equals("5")||mes[2].equals("6")||mes[2].equals("7")){//
				mountList.forEach(e->{
					if (e.getMountid()==Integer.parseInt(mes[2])){
						g.setColor(new Color(0xc9bd86));
						g.drawString(" "+CN_UPPER_NUMBER[e.getMountid()]+"·"+ e.getMountname().split(" ")[0],580,230);
					}
				});

			}else if (mes[2].equals("0")){
				g.setColor(new Color(0xc9bd86));
				switch (xuanzhong){
					case 1:
						if (shouHu.getQinglonglvl()<16)
							g.drawString("16级可添加",580,230);
						else 	g.drawString("待放入坐骑",580,230);
						break;
					case 2:
						if (shouHu.getBaihulvl()<16)
							g.drawString("16级可添加",580,230);
						else 	g.drawString("待放入坐骑",580,230);
						break;
					case 3:
						if (shouHu.getXuanwulvl()<16)
							g.drawString("16级可添加",580,230);
						else 	g.drawString("待放入坐骑",580,230);
						break;
					case 4:
						if (shouHu.getZhuquelvl()<16)
							g.drawString("16级可添加",580,230);
						else 	g.drawString("待放入坐骑",580,230);
						break;
				}

			}/*else if (mes[2].equals("-1")){
				g.setColor(new Color(0xc9bd86));
				if (Integer.parseInt(loginResult.getZhongtian().split("\\|")[0])<16)
				g.drawString("16级可解锁",580,230);
				else g.drawString("待解锁",580,230);
			}*/
		}else {
			g.setColor(new Color(0xc9bd86));
			g.drawString("待解锁",350,230);
			g.drawString("16级可添加",580,230);
		}
		// g.drawString("3级可解锁",450,65+100);

	} else {
		for (int i = 0; i < 7; i++) {
			sixiang[i].setVisible(true);
			hengtiaoxianshi[i].setVisible(true);
			hengtiaoxianshi[i].setType(2);
			if (i < 4) {
				if (shouHu.zhongtianlvl >= i * 3 + 3) {
					g.setColor(new Color(0xc9bd86));

					if (loginResult.getJiesuo() != null && loginResult.getJiesuo().split("\\|").length == 7) {
						String[] mes = loginResult.getJiesuo().split("\\|");
						List<Mount> mountList=UserMessUntil.getMountlsit();
						if (mes[i].equals("0")) {
							g.drawString(" 坐骑待选择", sixiang[i].getX() - 10, sixiang[i].getY() + 90);
							sixiang[i].setIcon(xuanze1);
							hengtiaoxianshi[i].setVisible(false);
							shouhuBtn[i].setVisible(true);
						} else if (mes[i].equals("-1")) {
							g.drawString("  可解锁", sixiang[i].getX() - 10, sixiang[i].getY() + 90);
							sixiang[i].setIcon(xuanze1);
							hengtiaoxianshi[i].setIcon(hengtiao1);
						} else if (mes[i].equals("1")||mes[i].equals("2")||mes[i].equals("3")||mes[i].equals("4")||mes[i].equals("5")||mes[i].equals("6")||mes[i].equals("7")){
							int finalI = i;
							mountList.forEach(element->{
								if (Integer.parseInt(mes[finalI])==element.getMountid()){
									g.drawString(" "+CN_UPPER_NUMBER[Integer.parseInt(mes[finalI])] +"·"+element.getMountname().split(" ")[0], sixiang[finalI].getX() - 10, sixiang[finalI].getY() + 90);
									if (element.getShouhu()!=0){
										try {
											shouhuBtn[finalI].setIcons(imageIcons1);
										} catch (Exception e) {
											e.printStackTrace();
										}
									}else {
										try {
											shouhuBtn[finalI].setIcons(imageIcons2);
										} catch (Exception e) {
											e.printStackTrace();
										}
									}
								}

							});
							sixiang[i].setIcon(MountShouhuBtn.getimage(Integer.parseInt(mes[i])));
							hengtiaoxianshi[i].setVisible(false);
							shouhuBtn[i].setVisible(true);
						}else {
							g.drawString("  已解锁", sixiang[i].getX() - 10, sixiang[i].getY() + 90);
							sixiang[i].setIcon(mount.get("50x50_" + Util.getRaceSting(loginResult.getSpecies_id()) + mes[i]));
							hengtiaoxianshi[i].setVisible(false);
						}
					} else {
						g.drawString("  可解锁", sixiang[i].getX() - 10, sixiang[i].getY() + 90);
						sixiang[i].setIcon(xuanze1);
						hengtiaoxianshi[i].setIcon(hengtiao1);
					}

				} else {
					g.setColor(new Color(0x959595));
					g.drawString((i * 3 + 3) + "级可解锁", sixiang[i].getX() - 10, sixiang[i].getY() + 90);
				}

			} else {
				if (shouHu.zhongtianlvl >= (i * 4)) {
					g.setColor(new Color(0xc9bd86));

					if (loginResult.getJiesuo() != null && loginResult.getJiesuo().split("\\|").length == 7) {
						String[] mes = loginResult.getJiesuo().split("\\|");
						List<Mount> mountList=UserMessUntil.getMountlsit();
						if (mes[i].equals("0")) {
							g.drawString(" 坐骑待选择", sixiang[i].getX() - 10, sixiang[i].getY() + 90);
							sixiang[i].setIcon(xuanze1);
							hengtiaoxianshi[i].setVisible(false);
							shouhuBtn[i].setVisible(true);
						} else if (mes[i].equals("-1")) {
							g.drawString("  可解锁", sixiang[i].getX() - 10, sixiang[i].getY() + 90);
							sixiang[i].setIcon(xuanze1);
							hengtiaoxianshi[i].setIcon(hengtiao1);
						} else if (mes[i].equals("1")||mes[i].equals("2")||mes[i].equals("3")||mes[i].equals("4")||mes[i].equals("5")||mes[i].equals("6")||mes[i].equals("7")){
							int finalI = i;
							mountList.forEach(element->{
								if (Integer.parseInt(mes[finalI])==element.getMountid()){
									g.drawString(" "+CN_UPPER_NUMBER[Integer.parseInt(mes[finalI])] +"·"+element.getMountname().split(" ")[0], sixiang[finalI].getX() - 10, sixiang[finalI].getY() + 90);
									if (element.getShouhu()!=0){
										try {
											shouhuBtn[finalI].setIcons(imageIcons1);
										} catch (Exception e) {
											e.printStackTrace();
										}
									}else {
										try {
											shouhuBtn[finalI].setIcons(imageIcons2);
										} catch (Exception e) {
											e.printStackTrace();
										}
									}
								}


							});
							sixiang[i].setIcon(MountShouhuBtn.getimage(Integer.parseInt(mes[i])));
							hengtiaoxianshi[i].setVisible(false);
							shouhuBtn[i].setVisible(true);
						}else {
							g.drawString("  已解锁", sixiang[i].getX() - 10, sixiang[i].getY() + 90);
							sixiang[i].setIcon(mount.get("50x50_" + Util.getRaceSting(loginResult.getSpecies_id()) + mes[i]));
							hengtiaoxianshi[i].setVisible(false);
						}
					} else {
						g.drawString("  可解锁", sixiang[i].getX() - 10, sixiang[i].getY() + 90);
						sixiang[i].setIcon(xuanze1);
						hengtiaoxianshi[i].setIcon(hengtiao1);
					}

				} else {
					g.setColor(new Color(0x959595));
					g.drawString((i * 4) + "级可解锁", sixiang[i].getX() - 10, sixiang[i].getY() + 90);
				}

			}
			//g.drawImage(hengtiao.getImage(), sixiang[i].getX() + 20, sixiang[i].getY() + 20, 37, 23, null);
		}
		g.setColor(Color.black);
		g.drawString(loginResult.getShouhu()+"",630,38);
	}




}

public List<MountPanelBtn> getShouhu() {
	return shouhu;
}

public void setShouhu(List<MountPanelBtn> shouhu) {
	this.shouhu = shouhu;
}

public MountShouhuBtn getQinglong() {
	return qinglong;
}

public void setQinglong(MountShouhuBtn qinglong) {
	this.qinglong = qinglong;
}

public MountShouhuBtn getBaihu() {
	return baihu;
}

public void setBaihu(MountShouhuBtn baihu) {
	this.baihu = baihu;
}

public MountShouhuBtn getXuanwu() {
	return xuanwu;
}

public void setXuanwu(MountShouhuBtn xuanwu) {
	this.xuanwu = xuanwu;
}

public MountShouhuBtn getZhuque() {
	return zhuque;
}

public void setZhuque(MountShouhuBtn zhuque) {
	this.zhuque = zhuque;
}

public MountShouhuBtn getZhongtian() {
	return zhongtian;
}

public void setZhongtian(MountShouhuBtn zhongtian) {
	this.zhongtian = zhongtian;
}

public ImageIcon getIco() {
	return ico;
}

public void setIco(ImageIcon ico) {
	this.ico = ico;
}

public JLabel getSixiang1() {
	return sixiang1;
}

public void setSixiang1(JLabel sixiang1) {
	this.sixiang1 = sixiang1;
}

public JLabel getSixiang2() {
	return sixiang2;
}

public void setSixiang2(JLabel sixiang2) {
	this.sixiang2 = sixiang2;
}

public void setzonglan() {
}

public DefaultListModel<String> getZonglanmode() {
	return zonglanmode;
}

public void setZonglanmode(DefaultListModel<String> zonglanmode) {
	this.zonglanmode = zonglanmode;
}

public int getXuanzhong() {
	return xuanzhong;
}

public void setXuanzhong(int xuanzhong) {
	sixiang1.setIcon(CutButtonImage.getImage("inkImg/Client/可添加坐骑格.png", -1, -1));
	sixiang2.setIcon(CutButtonImage.getImage("inkImg/Client/可添加坐骑格.png", -1, -1));
	if (xuanzhong>0&&RoleData.getRoleData().getLoginResult().getSh()!=null){
		if (Integer.parseInt(RoleData.getRoleData().getLoginResult().getSh().split("\\|")[xuanzhong-1].split("-")[1])!=0){
			sixiang1.setIcon(new ImageIcon("inkImg/Client/zqhead/50x50_"+ Util.getRaceSting(ImageMixDeal.userimg.getRoleShow().getSpecies_id())+Integer.parseInt(RoleData.getRoleData().getLoginResult().getSh().split("\\|")[xuanzhong-1].split("-")[1])+".png"));
		}
		if (Integer.parseInt(RoleData.getRoleData().getLoginResult().getSh().split("\\|")[xuanzhong-1].split("-")[2])!=0){
			sixiang2.setIcon(new ImageIcon("inkImg/Client/zqhead/50x50_"+ Util.getRaceSting(ImageMixDeal.userimg.getRoleShow().getSpecies_id())+Integer.parseInt(RoleData.getRoleData().getLoginResult().getSh().split("\\|")[xuanzhong-1].split("-")[2])+".png"));
		}
	}
	this.xuanzhong = xuanzhong;
}

public static Image icochange(String path){
	// Replace with the actual path to your image
	File imageFile = new File(path);
	BufferedImage originalImage = null;
	try {
		originalImage = ImageIO.read(imageFile);
	} catch (IOException e) {
		e.printStackTrace();
	}
	if (originalImage==null)return null;
	int maxSize = Math.max(originalImage.getWidth(), originalImage.getHeight());
	int scaledWidth = originalImage.getWidth() * 45 / maxSize;  // Adjust 50 to your desired size
	int scaledHeight = originalImage.getHeight() * 45 / maxSize; // Adjust 50 to your desired size
	return originalImage.getScaledInstance(scaledWidth, scaledHeight, Image.SCALE_SMOOTH);
}
static class CustomScrollBarUI extends BasicScrollBarUI {
	@Override
	protected void configureScrollBarColors() {
		// 修改滚动条颜色
		trackColor = Color.black;

		setThumbBounds(0, 0, 3, 10);
	}

	@Override
	public Dimension getPreferredSize(JComponent c) {

		// TODO Auto-generated method stub

		c.setPreferredSize(new Dimension(10, 0));

		return super.getPreferredSize(c);

	}

	@Override
	protected JButton createDecreaseButton(int orientation) {
		// 移除上翻按钮
		return new JButton() {
			@Override
			public Dimension getPreferredSize() {
				return new Dimension(0, 0);
			}
		};
	}

	@Override
	protected JButton createIncreaseButton(int orientation) {
		// 移除下翻按钮
		return new JButton() {
			@Override
			public Dimension getPreferredSize() {
				return new Dimension(0, 0);
			}
		};
	}

	@Override
	protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds) {

		Graphics2D g2 = (Graphics2D) g;

		GradientPaint gp = null;

		//判断滚动条是垂直的 还是水平的
		//垂直
		if (this.scrollbar.getOrientation() == JScrollBar.VERTICAL) {

			//设置画笔

			gp = new GradientPaint(0, 0, new Color(0, 0, 0),

					trackBounds.width, 0, new Color(0x7f6e59));

		}
		//水平
           /* if (this.scrollbar.getOrientation() == JScrollBar.HORIZONTAL) {

                gp = new GradientPaint(0, 0, new Color(0, 0, 0),

                        trackBounds.height, 0, new Color(0, 0, 0));

            }*/


		g2.setPaint(gp);

		//填充Track

		g2.fillRect(trackBounds.x, trackBounds.y, trackBounds.width,

				trackBounds.height);

		//绘制Track的边框
           /*  g2.setColor(new Color(175, 155, 95));
         g2.drawRect(trackBounds.x, trackBounds.y, trackBounds.width - 1,
                trackBounds.height - 1);*/


		if (trackHighlight == BasicScrollBarUI.DECREASE_HIGHLIGHT)

			this.paintDecreaseHighlight(g);

		if (trackHighlight == BasicScrollBarUI.INCREASE_HIGHLIGHT)

			this.paintIncreaseHighlight(g);

	}

	@Override
	protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) {

		// 把绘制区的x，y点坐标定义为坐标系的原点

		// 这句一定一定要加上啊，不然拖动就失效了

		g.translate(thumbBounds.x, thumbBounds.y);

		// 设置把手颜色

		g.setColor(new Color(250, 250, 250));

		// 画一个圆角矩形

		// 这里面前四个参数就不多讲了，坐标和宽高

		// 后两个参数需要注意一下，是用来控制角落的圆角弧度

		//  g.drawRoundRect(0, 0, 5, thumbBounds.height - 1, 5, 5);

		// 消除锯齿

		Graphics2D g2 = (Graphics2D) g;

		RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING,

				RenderingHints.VALUE_ANTIALIAS_ON);

		g2.addRenderingHints(rh);

		// 半透明

		g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,

				0.1f));


		g2.fillRoundRect(0, 0, 20, thumbBounds.height - 1, 5, 5);

	}


}
}
